Execute Script
AutomatR.Web.ExecuteScript
The "Execute Script" activity in AutomatR's Web Activities category allows you to execute JavaScript on a web page. This activity is crucial for injecting custom scripts into web pages, providing flexibility and extended capabilities in web automation workflows.
Properties
Name | Description |
---|---|
Input | |
Script | Browse the path of the JavaScript file to be executed on the web page. String variables containing the script path. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. String variables containing the desired display name. |
Optional | |
Delay | Enter the wait time in seconds (Example: 5 seconds i.e., 5) before executing the "Execute Script" activity. Useful for handling synchronization issues. |
Output | |
Result | (Currently commented out in the code) Outputs the result of the "Execute Script" activity. The result can include data returned by the executed script. Variables of relevant types (e.g., object variables) to store the operation result. |
How to use:
- Drag and drop the "Execute Script" activity onto the workflow.
- Configure the "Script" property by browsing the path of the JavaScript file to be executed on the web page.
- Optionally, configure the "Delay" to introduce a wait time before executing the "Execute Script" activity.
- Execute the workflow to inject and execute the specified JavaScript on the web page.
Example: Consider an example where the "Execute Script" activity is used to inject a JavaScript file named "customScript.js" into a web page:
Execute Script:
Script: "C:\Scripts\customScript.js"
Delay: 2
In this example, the activity injects and executes the "customScript.js" file on the web page. The specified delay of 2 seconds provides time for the web page to load before executing the script.